package com.freeter.modules.recalc;


import com.freeter.common.utils.R;
import com.freeter.modules.gjs.service.ReCalcCompoent;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("recalc")
@Api(tags="重算")
public class ReCalcController {

    private static final Logger logger = LogManager.getLogger(ReCalcController.class);


    @Autowired
    private ReCalcCompoent reCalcCommpent;

    /**
     * 重算
     */
    @GetMapping("doCalc")
    @ApiOperation("重算")
    public R sendCode(HttpServletRequest request, HttpServletResponse response){
        reCalcCommpent.doReCalcStock();
        return R.ok("开始执行");
    }

}
